Changes in training3 to make it easier to modify its parameters.