added -writeCNF option