Adding gitignore
Using pipelined iterator, various code refactoring