Added main.py functions from master (blog etc)