Added writing stats to Std Out and files as well.