Updates to library.js (Work still in progress, not affecting functionality)