optimized distance calculator
Merge branch 'develop'