modify output and add a test script with validator.py