adding menu and getCommand functions