added changing animation speed with velocity as specified in project requirements