fixed binary labels, and sort entries returned from dm