updated trainer.cpp to real trainer