reformulated some predicates
created variable for sortOrder and moved it out of the loop
reworked the creation of sort names for persons