corrected sort impl.
dsgadgs