@imanimgabriel1 , You wrote, “two error messages within these pieces of code”…
What error messages? On what lines of code?