working thru smallest value in array