Updated generator to new reference implementation