adding findMinValue and test