Writing a custom transformation operator