Refactor unwind function.
Add .gitignore file.