adds animation code