some code cleanup, added comments
gitignore