Own oimplementation of my_move function