refactored animation code
changes