Added animations and cleaned up code