working version with new stats