Write Variance Function