fixed some bugs in training, need to look at adjustment of weights step