replaced the 2 train functions by 1 allowing a variable to be passed to select the training requirements