Adding output function with line count.