add train by one line function