Moving if statement out of for loop.
Added .gitignore