added geom2rect function