changed finalize to return an array of books, not a map