Added code for when confidence level is not accomplished.
Various changes not affecting behaviour