removed bugs. fixed heredoc. typos