Now supports granularity in chapters not books and sorting by attribute