changed ref to input records to output records counter