Update and move function