Modified animation code