Proper animation loop