adding training code