Modified sortBook method to reflect the book's state