mode compare func to .cpp file