added line counting