finish initial version of spatial scan