BUGS. trying to get the grid indexing working.
things are working OK at the moment, except for affectMat stuff I think.