min algorithm: speedup due to using list instead of array for the intensity, min function faster