modified the menus to take an IORef as a parameter, and modified visible and invisible to work on the modified menus.