finished findNthvalue