Better function to animate an item