Not as much of a fan of some constrain function as you are (maybe Paul is on my side with this too). You need to be aware of what you set the array indices to instead of constrain them in case of overflow. I'd get rid off all these constrain function before asking again what's wrong with the code.
BTW, you constrained the hum1MinIndex to 0-6 but you only have 6 element in the relevant array so once hum1MinIndex==6 you destroy the chicken world. Good work giving the chicken the inevitable. They should chant iiagdtd ]![]()