cleanup and added animationSpeed variable