The edit substantially improves the question, and does not change what is being asked.
The code changes made an entirely unreadable block of code much more readable, and did not change the contents of the code.
The non-code changes helped make the question clearer, and corrected a lot of the grammatical problems - again, without changing the actual question being asked.
I would agree with the approvers that this is a good edit.
There are more corrections that could be made - such as removing incorrect backticks, but what was done was a substantial improvement. If anything, I'd suggest using the
Improve button to correct the few remaining issues.