make final print more compact
added close() call to Scanner object