first step code for animate