Add the open and close function. Functionnal prototype.