Checking less and correct combinations in distance calculations.