added code from danieljdufour/geomakers