bug fix in min_list function