refactored example to "transformSelectedText"