Finish code for animations. Still requires a few bug fixes