added search.py and edited begin.py to export the error message to a text file