add start and stop conditions for minimzer loop