using line policy in count_lines
keeping both fast and filter versions of count lines