line-by-line method