code generator for tuples