modify training code