modified train_model.py