Added second implementation that avoids much of the overhead of the first. It still gets the same line back, however.