fix code for computing least sort of KItems
Merge pull request #635 from dwightguth/kitem

fix code for computing least sort of KItems