introduced faster implementation for distance calculation & added some more logging functionality