Implemented findSmallestValue