updated stats functions