modified formula for likelihood