Function num_of_moves was added (commented)