optimized spatialgrid
merged with openmp. minor changes to spatialgrid.
41 seconds for 10000 .1 .2