fixed the chooseK utility