trying the train function