Updating Adjacency Matrix implementation