Refactored approx into a module and applied it to the geometry tests.