Returned maxDist where it was before, because if k is equal to 1 the predicted attribute always will be zero