recursive menus generation