theorically better stats calculation, but returns SEGMENTATION FAULT