Using findSmallest in the scan iterator