Latest Code for Trainer tool