Finalized graph production code.