Added animation class, refactored