Added function for opening a library