moved Geometry constructor and destructor outside