Animate function is working adequately