Implementation of move-valid_moves