made maxDist make more sense (slight accuracy loss but who cares)