fixed typos, cleaned up the code, removed Bash-Strict-Mode