Cleaned up animation code