format_grid_data rewrite done for realz