fixed calculate_grid_row / calculate_grid_col functions in grid.hpp