change print to $stderr.puts
update tests in TestGeometryManager
clean up code