compute the variance