There is something else wrong with that code; the repeated use of the == operator. I think the chances of any of those ifs being executed are slim, because those == operators will probably all return false, unless the indices are the same.
look! it's a bird! it's a plane! It's .... a teeny tiny ad