Fixed a potential array out-of-bounds bug on line 18. Added a .gitignore to keep the .swp files out.