Or in other words you are doing research, a bit like a PhD and the book is a byproduct!
Like how HN was recently talking about 8 hours to code the first time, but half hour to retype the same code from memory the next day. The code is almost an small (but critical) artefact.