Refactoring.
Fixed glitchy animation.