Define and use helper function binaryOp