tidy
rough rewrite of array order resolution
refactor and annotate
fix scope on map
remove globals
xref src to remove dupes
fix info.deleted index
fix total
linted and tested