porting Criteria to CPP