Make corpus.py functional