Code optimization

MAD + Variance + StDev