fixed the code to pass freetest.py