Fix how to calculate variance