make script more verbose and deal with CRLF line endings