Jane,
Why not make that an input parameter when you are initializing the software. "How many stages in the match?"

Then it is forever correct.

Ken Reed