code for animation remote and local