Functions fixed. Also main.py is almost done now. Needs some testing and more blob handling.