fixed Warnings: remove unused import and closing jar file now. And a little cleanup for better legibility.