attempt to implement update weights algorithm. Tests FAIL. Bug on line 96.