improve error messages, close input stream
more eye candy
comment out unused code