     let favoritesUserDefaultsKey = "FavoriteBooks"
     
     var tags = [String]()
+    var books = BooksArray()
     var dictionary = [String: BooksArray]()
     var isLibraryChanged = false
+    
+    let sortClosure = { (book1: Book, book2: Book) -> Bool in
+        return book1.title < book2.title
+    }
     
     init (json: NSData) {
         if let jsonArray = try? JSONManager.loadFromData(json) {

        } else {
            dictionary[favoritesTag] = dictionary[favoritesTag]?.filter({ $0 !== book })
        }
        
        isLibraryChanged = true


    func sort() {
        tags.sortInPlace()
        
        books.sortInPlace(sortClosure)
        
        for tag in self.tags {
            dictionary[tag]?.sortInPlace(sortClosure)
        }
    }
    
