Bug Fix - Confidence

Confidence array was not being set correctly.
Changed for each loop to traditional for.