Code to output statistics