Format cleanup.
Fixed bug in distance calculation.