Added toLibrary method