clean up a bug in the adjacency matrix