modifying wiki.py to write to outfile