finished moving function