add text editing functions and demo