Smart thinking keeps prison creative writing programme going