working animation. refactoring complete