fixed a bug with adjusting weights, need to debug training more.