Changed animation code to be more timer based