Faster method for computing graph statistics

There are some drawbacks to this method, the main one being that we have
top run all the parts consequentially (and we cannot run them one by one
to test for errors for example).