Update library.js

Updated library.js code.