Written the word selection logic
Modified text selection logic