code changed for computing confidence level for each line