menuitems and supporting code