Added training code