removes generated output
ignores swap files
refactors the file to remove hardwiring, and improve code flow