make corpus generation work
Remaining code from hackday