getWmat now works for undirected graphs