added some more error handling and removed functions.py
cannot push, testing
latest commit with removed functions.py and error handling