Add .gitignore
Strip trailing whitespace
Refactor