added code from sand. Used get.adjacency() to obtain adjacency matrices.