refactored changing directory code
updated gitignore to ignore temp