Tidying periodic_exact_match.py