If you put each { on a new line, and use the Tools + Auto Format menu item to reformat your code, you'd end up with something much more readable.
I can't believe, either, that it takes all that code, with nary a Serial.print() in sight, to demonstrate your problem.