made mainLoop work for old grid with just mesh and new grid that contains CellObj's