changes in the TrainGLM function