#9 added try-with-resources