Fixed bugs and added a .gitignore