started code for getting the stats