Added the animate function.