Contacts Related Code Understanding

I am new to Swift programming (and, truthfully programming in general, as the last time I did any meaningful programming was in Fortran some 30 years ago).

I am probably way over my head given I have only been learning “self-taught Swift” during work breaks for the last week or so but figured I would do something positive during the “COVID-19 shutdown”.

I am working on a Contacts related project (identifying duplicate contacts, reformatting addresses, reformatting phone numbers, etc.) and am stitching together various bits of code – some mine, some found on-line – and I want to make sure that I understand the below code (which, hopefully I have, given I have been at it for the last 3 hours with most of the time spent trying to learn the Contacts Framework, no lack of effort here!)

I would greatly appreciate someone confirming that my comments / understanding is correct and, where it is not, then correcting it.

Thanks in advance.