Added method for gather statistics.