Cleaned up code, animation bug fixed