modified code_generator and tested (minimal) with various select commands