Wrong way of calculating undirected degree