Finalized graph script