added confidence, result into global var