added *.swp to .gitignore
Added new file processing function which handles all file processing together in one.