If you want autotuning you probably want to consider the effect of this line:
boolean tuning = false;