Updated .gitignore and optimize script.