closing files and cleaning up a tad