moved main functions to py_filehandler.py