Everything interconnected.
Modified the flow of the KNN calculation in order to avoid recalculating
the distances for the same distance type but different neighbour number.