moved corpus function body to cpp file