modified docstrings and return type in the transform method