Added functions to create adjacency matrix