added functionalities to textWritter