visualization code to include open and close