fix Grid.get_coordinates function