updated CalcStats will several new functions