put a for each loop in min