Some text entry logic