Implemented animation. Needs some cleanup.