last few changes to Trainer.cpp