fixed min_array, now doesn't return 0 all the time