fixed a lot of bugs with training. update was not 100 percent correct. also added new features