Integrated the "not bad becomes good" algorithms