Add beginning of functionality for training the model