First working adjacency matrix implementation
First working adjacency matrix implementation- cleaned