Using try with resources. Forgot that java has them.