my algorithm seems to be making very slight mistakes when taking paths and results in very minor changes in weights. need to investigate algorithm