implementing UnaryOperator and BinaryOperator