sort count on hand implemented