modified summary stat calculation