cleaned up animation code