changes to support the library as a module