added code for animation;