taking header into account when counting lines
correctly count the number of lines when filtering
stop