Implemented open and close methods. Seem like they will work but need testing to be sure