remove 'next_state' parameter for write_irreg
cleanup
cleanup
removed -1 and -2 from command line (auto detected)