updated gen code