Invalid Array - Inconsistent

You don’t need a chess square reference variable. Remove it.
Add clear stage square array before going to the first for each loop.
What happens if non of the stage reference integer and stage number aren’t equal?