added line-by-line parsing