Implemented some basic open/close functionality