Improved stats calculation. hopefully