Increase performance and reduce blinking

remember the last written line to prevent writing the same line again