added stats functions