changing min from 0 to -inf