added IMGrid object (in grid.py), grids now precomputed