getLibrary function now gets libraries