Adding statistics gathering and printing