Finished implementation of Trainer.