added wrapper and way to test distance function