Code Clean Up

Changed setTimeouts to the AnimationTimer object and updated function names