Fleshed out most of the train functions.