Closing snippet and input files.  switched to try with resources