add functions for corpus, primary set & cleanup