Spatial Grid code done for now, badly needs debugging
did spatial grid stuff
merged