Got the stats queries implemented