Revert "fixed bug in find k smallest elements algorithm"

This reverts commit 31679374dc5115f26dbac7754505109b4543f7db.
fixed find k smallest element algorithm