Fixed error in the adjacency matrix implementation. How did it work previously???