In this paper we introduce a canonical minimised adder graph (CMAG) representation that can easily be generated with a computer. We show that this representation can be used to efficiently develop code generation for MAG graphs. Several code optimizations methods are developed in the computation of the non-output fundamental sum (NOFS) computation, which allows the computation of all graphs up to cost-5 be accomplished in a reasonable timeframe.