added gencode code structure + a function to construct each line of the resultant prog