modify findKth implementation