Added function for opening and closing the menu.