Updated to work with differently orientated menus.