Added functionality to write shapefiles as an output too

improve mapping