Adding init and closing methods for the library.