3rd version that outputs selected text