Adding function to print stats at end of sort