sorting in 2 directions seems to work; need paramatrized thresholds and VERIFICATION of current behavior