Filled in the scan function, which returns the column location of the smallest positive value in a 1xn vector.