Saw some others using this, so might as well join in.
Pretty sure it works as it should. :) -I think I screwed up somewhere, but it's kinda late as of typing this, so I'll try to fix tomorrow -Update: Fixed!