fixed functions for distance
Merge branch 'master' of https://github.com/ultralaserdeluxe/gloria