Optimized distance calculations
Merge branch 'master' of github.com:dakaufma/maslab2012team10