Adding stats calculation