added ability to handle likelihood with zero variance