It was during this time in gaol that he wrote his allegorical novel: "Pilgrim's Progress". We do not know whether he wrote it all while he was in gaol. The book is in two parts. The first part finishes with the words: “So I awoke, and behold it was a dream”. When the second part begins he says “..as I slept I dreamt again”. This might mean that he wrote the second part in 1677 when he was in gaol again. This is only a guess, we do not know.