Now it is much faster to output 'kth' graphs