added the possibility to set a max char length for the line output