fixed a bunch of bugs with confidence score