Finish moving function.