adding gold code generation logic, havent tested yet...