updated ES to use io functions for getting selected text, etc.