ex16 text editor exercise