Behvaior conditions work, but need overhaul. Trials counter is messed up.
Complicated algorithm for finding index of closest value to given value is working.