fix getting number of chapters in book
remove debug output
rewrite getBook function