Adding Support for Writing stats to file