Added the menu generation code