Updated move function to work