algo with confidence implemented