fixing some bugs, and adding a gitignore