cleaned up raster split function