Code cleanup, and very minor optimization
Updating gitignore