Simplified adjacency matrix. Updated some tests.