adding .gitignore
refactoring code