deleting temp files and closing input streams
Merge pull request #3 from luis100/better_io_handling

deleting temp files and closing input streams