completed findIthSmallest