Cleaned up code and updated .gitignore.