improve code and add comments
update gitignore