Added optional duration limit, adjusted min def again