Cleaned up code. Added animation.