completed moran test. trouble with running a for loop and writeRaster