Added gitignore
Some improvement and added bit test.