simpler while loop, add source_lines method to Document