Added attr weight to be returned
Added weight to nodes
Added calculation for node weight