Fixed the Distance Comparison bugs by using a new KeyComparator class of type Comparable<NodeId> and using BigIntegers to represent the keys and letting BigInteger do the comparisons