safer zscore calculation