Compute statistics helper functions