added animate() function