Adding sort ratio and sort min distance