Added generate_var