changed the library to a single function