attempting to make the librarian script more versatile