updated shapefile generating function