implemented open and close incrementally functions