add comments in mac_grid.cpp to make code more readable