Trying to optimize run time of match_letter.py