This term of imprisonment actually proved to be a blessing in disguise, for it was while he was in prison that he conceived the idea of writing a long imaginative romance, with two princely brothers as heroes living adventures in a world full of magic charms and enchantments and strange beings. This was the beginning of the famous Phra Abhai Mani, one of the greatest imaginative works ever written. It was not completed until the poet was middle-aged, but he was able to sell many cantos of it in manuscript form to a delighted public while he was in prison, and thus earned a handsome income for himself.