Implement applyTransformation; not tested