Added code for handling text on screen