Modified counting sort into correctly good.