Some changes in move function