added more options to writetext