clearly define open and close for all functions