finally fixed text output
double endlines etc. are now working properly