public int CheckForIndex(int index, int check) { if(check == index) check = 0; else if(check > index) check -= 1; return check; }