added base training code