better line counting for new filter