Adding counters to obtain statistics, error checks