moved this to train.jl