added weighted edges