working on the structure of match.py