Added support to find the kth smallest element