full training code added