Adds gitignore and uses correct method in example.