updated adjacency matrix