training code and exercise