added some debugging to grid.m