need to fix variance computation