now using stream.eol() instead of stream.peek() != null