added weights to nodes