partial implementation of line-seq