Added waypoints code for animations