Modified to count arbitrary line lengths, but print only as much as it can reasonably