added animations, cleaned up code