Unlike binsort, binsort2 actually works.