added "writeTextToDisplay" function