ENH: Adding statistics collection code.