Finished writing trim.py.