The double-backlink at the bottom is amusing - I recognize this bug from painful experience. OP counted each of the 2 links in the other article as a backlink, and didn't deduplicate. But... if you deduplicate, then you are unable to do true bidirectional backlinks to the original caller. You can't figure out 'which' link in the other article is meant.
You need HTML IDs set on each, but they have to be different ID-anchors (obviously, and also because it'd be bad/invalid HTML to have duplicate IDs). So you actually need to track not just the other article but the ID inside the other article, and a way to generate those link IDs to begin with (since you definitely don't want to do it by hand). Gets tricky.