For the code render issue - Just copy the formatted code here and then add 3 backticks (```) to the line in front and the line after.
I’m about to head off but I’ve added a reminded to take a look at this and your other question when I get back online tomorrow.