-ADDED determine_grid_coordinates