added functions to main script and fixed .gitignore