added reading functionality to stats.c