weight added to matrix and distances added but not working yet