Added text writing func.