this...
I don't think this part is kosher... consciously keeping track of both numbers and use them to get the result. this is equivalent of all cards being flipped face up so the magician can teach to mark how to do the trick:
 Code:
			If $ = $b ;if both calculations match then set the output (since one counts up and the other counts down this is always the last iteration
				$a = $t
_________________________
!

download KiXnet