variance computation got memory efficient