Improved it and reduced number of lines. Buff class was removed since it wasn't necessary anymore, just as the printedChars variable.