Made adjustments to first method, and applied the *heredoc* method