match.py cleanup and comments adding