Add debug code. Ensure understanding of MatchData implementation, use of named captures in code.