added stats generation functionality