Fixes #3 using code from GraphCT.