added code for SPC stats