remove debug statements; clean up book; and strip newlines in messages