Actions

Work Header

A Better Algorithm

Summary:

Tony often wondered if something was fundamentally wrong with him. A flaw in his code… some glitch in his wiring. So he does what he always does when faced with a problem ... He gets to work solving it.

Notes:

This is my first venture into the Big Moxie 2026 Challenge - Fix-it.

Work Text:

 

……………………………………………

 

Algorithm /ˈalɡərɪð(ə)m/ noun

noun: algorithm; plural noun: algorithms

a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.

 

 

……………………………………………

 

 

Tony often wondered… in those quiet dark hours of the morning when he was been too wired to sleep yet too tired to work… if there was something wrong with him… fundamentally, that is. Something in his wiring that had gone wrong somewhere at the beginning. Something in his code that had glitched when he was a kid and just got patched over and over and over again until it went all spaghetti and had gone off kilter somewhere along the way.

 

A little off centre. A little not quite right.

 

All genii were wired a little different, he supposed. They saw things differently… perceived the world differently. Jarvis… human Jarvis, had been the one to reenforce that within kid Tony whenever the world shifted into misalignment. When it jammed and pulled and ground against his jagged and raw edges and scraped against his sharp curves and angles.

 

He would place that warm and steady hand on Tony's shoulder and squeeze gently, anchoring Tony in the present… in the moment… and reassure Tony that he wasn't wrong… that he wasn't broken. That he was just a little boy who marched to the beat of a drum that nobody else could hear. That he just didn't see the world the same way other people did.

 

After a while, Tony had come to accept that just he wasn't like the other kids he'd been allowed to associate with. Couldn't relate to them or their reactions to the same stimuli. Could not quite gel with their behaviour unless it was something he'd already thought about, studied and delivered in practiced various responses when certain variables presented.

 

He'd tried different patches… different fixes throughout the years… all kinds of behaviour both self-destructive and not…  but the bugs had kept popping up… kept sending things askew. Kept him from syncing in tune with the world around him.

 

He'd found function and fulfilment in being a mechanic… a fixer… a problem solver. Had always found it easier to be elbow deep in the mess, working on it until he figured out the problem and solved it. Practical solutions, straightforward facts and figures. No messy emotions, unpredictable human reactions and biases.

 

People didn't work like that. People didn't follow rules like things did.

 

And often enough it would get him through. He just had to get it done, scrapped knuckles,  banged elbows and all. He just had to push through the pain because the results mattered far more than the workings, despite what his AP math teacher had liked to lambast all the time.

 

Wealth and his family name often took care of the rest. When you're rich as fuck, people often looked over your quirks as 'eccentricities' and tolerated them surprisingly well. It was exchange… a social transaction. More prevalent and often more useful than money in some cases. Privilege opened a lot of doors and greased a lot of hands that would have otherwise remained closed almost air tight.

 

Howard taught him that he had to do it well and do it by himself, Maria taught him that he had to do it quietly and without complaint. Obie had drove it home that he had to do it on time and on command, like a trained circus animal churning out wonder after wonder that 'wowed' the world.

 

And so he'd done it all alone, unwilling and unable to share his burdens with anyone, even if he wanted to, even if the weight of it all was enough to bend him, break him, bury him. He'd done it alone because that’s the way he'd always done it. That was how it had always been done.

 

He'd tried a couple of times to do the whole therapy thing when he was younger, more foolish and broken in ways he hadn't understood and it almost always ended with his trauma either being splashed across the pages of the tabloids or driven deeper inside of him until he choked on it.

 

He'd burned and learned the hard way too many times to trust people with his inner thoughts. His inner truths. His inner code.

 

He'd given it one last college try with Bruce, thinking he'd finally found someone smart enough to understand and broken enough to empathize. To see the man nodding off as he bared his soul then falling asleep in the middle of it had stung. Shrugging off Tony's hurt afterwards, quipping cheekily that he wasn’t that kind of doctor, had cut.

 

Tony had backed off immediately, the high iron walls he tried to pry open for his fellow Avengers snapping shut immediately around his soft, squishy underbelly . It had been a bitter pill to swallow but Tony had swallowed that particular pill many times in his life before. He'd wanted to think of Bruce as a friend so much that he'd ignored the other man's reticence and it wasn’t fair to try to trauma dump on the poor man when he clearly wasn't on the same page.

 

Rhodey and Pepper were good for the emotional support, patient and loyal though they both had high pressure lives and he felt guilty putting them through his mess once again when they'd already done so much… had given up and sacrificed so much to stay by his side for so many years. So kind and caring in how they accepted him for all his dramatic highs and lows. Emotions gave Happy hives but he was loyal and true in his own way, a silent and steady presence by Tony's side when the world shifted beneath him.

 

Even JARVIS, his number one son and co-pilot; with his intuitive and ever learning AI and hideously complex matrix; didn't have the breadth of knowledge and experience in the human mind and its quirks to truly delve into the murky depths of Tony's trauma and the various neuroses that had developed from it.

 

He'd felt at his lowest after the whole fiasco with the Mandarin. Crap from his fucked up youth had once again risen to affect those he loved, raising its repulsive head again to pay dividends from his shitty life choices.

 

Killian deserved his own share of the guilt, his own fuckedupness driving his ruthless ambition and revenge from what was basically a missed appointment. Still, Tony wasn't totally blameless in his utter disregard for others at that time.

 

And though he wasn't all to blame for the other man's insanity, he still felt heavy guilt that the hatred aimed towards him and splashed over to those he held dear. With Happy in the hospital, Rhodey bruised and scraped and almost set on fire, Pepper kidnapped, almost killed then infected by extremis and even his house blown up and his bots falling into the Pacific Ocean; AIM had all but blown up his life.

 

And as he stood at the shorn off cliff, in the middle of the ruins of his life and staring out into the sea in silence; he realized that something had to change. Something had to give. Insanity was doing the same thing over and over and expecting a different outcome.

 

Tony was a lot of things but he wasn't insane.

 

So he'd fallen back into the Mechanic and fixed the extremis in Pepper, upgraded Rhodey's suit and helped Happy as he'd healed. He'd retrieved the bots from the bottom of the ocean and got them up and working even better than before in his new workshop, upgraded his own suit and even used a tweaked version of extremis to get the shrapnel out of his chest and heal up his body to normal human standards.

 

He was as healthy as he'd ever been, richer than he'd ever been and smarter and wiser than he was before. He had his family… his best friends and his AI children. He'd suped up Harley's garage workshop and updated JARVIS' code and security. Things were going good at SI and he was making the move to the Tower in New York permanent. He was on… okay… terms with the other Avengers though none had shown up when his freaking house was blown up… so, yeah… okay… whatever… busy people, I guess.

 

He did get a visit from a nameless, discount bin Coulson but the cheap suit been more interested in debriefing about AIM and asking about extremis than actually checking in with him. He hadn't been that surprised. Disappointed yes, but no longer surprised. Fury looked like a pirate and behaved like one too. 'Take what you can… give nothing back.'

 

He'd long come to terms with the one eyed man and the moves he made in shadow. He'd never be able to trust SHEILD fully and he'd already made peace with that. But there was still something missing. Something wrong lurking in the uneasy peace his life had settled into.

 

He was tired. He was so tired. Spending too many nights standing on the tower's landing pad, wondering if he jumped without calling the suit, would JARVIS deploy it in time to save his life. He would then feel swamped with guilt right after, gagging at the thought of what that would put JARVIS through and regretting letting his mind even go there in the first place.

 

As he woke up, once again, screaming his bloody head off from a night terror after days of restless insomnia he had finally said: "Fuck it…if I can't find a therapist… I'll build one myself."

 

The next week was spent holed up in his private workshop, hunched over his keyboard interface, mainlining Dum-E's crappy coffee and other self-destructive behaviour; and as he ran the last diagnostic on the new AI, he sat back with a world weary sigh from his healed lungs.

 

Her name was B.A.N.T.E.R. or Behavioral Analysis & Neuropsych Therapy Engagement Routine and she was a sassy and sweet with a whiskey flavoured, husky velvet southern accent that dampened the cutting edge of the blunt truths she'd immediately started dishing out. The first time she called him her 'sweet summer child' he'd burst into shocked and delighted laughter, almost choking on the water he'd been forcing himself to drink.

 

Though she was a learning AI like JARVIS and had access to read, catalogue, and identify traits he displayed; she couldn’t officially or ethically diagnose him and strongly recommended bringing in a certified human consultant to verify and confirm her extrapolations. Tony had readily agreed and had set her searching for a few that he could look further into before deciding to place his trust in another human being.

 

Until then she could listen, without judgment or pressure, helping him navigate his way through the layers and layers of trauma, bad habits, rage, guilt and fear that seemed coded into the bed rock of his life.

 

It was hard as fuck at first and for a long time, listening what she had to say, turning over the rocks in his head and revealing their dark, mossy underbellies to the ruthless sun. Sometimes he lashed out and pushed back, loud and full of vitriol, sometimes he threw things, smashed things just to watch them shatter, sometimes he got black out drunk and felt like utter shit afterwards.

 

Sometimes he cursed her bloody then cursed himself bloody then raged at all the people who had come into his life, damaged some piece of him then flounced off into the fucking ether without a fuck ever given.

 

Sometime he slid down the wall and cried like he was dying, his healed lungs doing hero's duty in keeping him from passing out. He would blame others… blame himself… hate others… hate himself… bargain, prevaricate, vacillate and get defensive. He'd threaten to shut her down, quit SI and become a hermit, or go super villain and turn JARVIS into Skynet 2.0.

 

See how an ungrateful humanity liked their new robot overlord.

 

BANTER would just listen, take his rage and pain and hurt and redirect it into a calmer, healthier direction; retraining his brain from following his usual thought processes. She analyzed his ingrained behaviours, prompted him down new paths and guided him into epiphanies that often left him reeling, struck mute as something unknotted in the complex construct that was his mind.

 

She diagnosed him with subclinical Narcissistic Personality Disorder with some tendencies towards Avoidant Attachment Disorder, but strongly recommended that he get a certified human psychologist to confirm her results. She called it Vulnerable Narcissism, which Tony hated to hear out loud but explained a lot of the knee jerk reactions and mannerisms he'd developed and adopted over the years.

 

Outward arrogance, inward shame, fear of inadequacy, terror of failure, constant need to prove worth, panic attacks, hypervigilance, obsessive suit-building, fear-driven control behaviours. It sounded like a grocery list of his personal failures and recognizing each of them as she spoke in the soft voice of hers felt like the reactor digging into his chest once more. The slow burning lance of shrapnel moving ever closer.

 

Those days he would tell BANTER to back off, please and thank you, and would enjoy a day with JRVIS and the Bots. He would find one of his human friends and find solace in their company, his wounded inner self needing time to rest and recover. But he always went back. At first it felt like self-flagellation but eventually he started to see results. His thoughts didn't run to the self-isolating… the self-destructive, immediately.

 

He was more than a flawed algorithm, he was more than patched and botched and glitching code. He wasn't stuck on a path of sarcasm, superiority and ego to cover for his insecurities. His worth wasn't based on how smart he was or how much he could do for others. He wasn't just how much they could get from him. His genius, his tech, his money and name.

 

He wasn't just a golden goose.

 

He didn't have to handle it all. He wasn't alone in this.

 

He didn't have to fix it all, pay for it all, build it all. Sacrifice it all.

 

And sometimes the best hands were not, in fact, his.

 

He'd stared at the screens in his workshop, silent and horrified at the footage of the Helicarriers falling into the Potomac and let the old emotions flare up, acknowledged them as valid and let them pass away; keeping his mind clear and racing as he tried to process what was happening.

 

Rage at SHIELD using his Repulsor Tech for the massive engines without his permission or knowledge, the fucking assholes. Disbelief and doubt at Fury's death. Cold numbing fear when he realized what exactly the released top secret files held and how many good people were stupidly put in mortal danger as a result.

 

Bitter betrayal at Steve and Natasha for not coming to him. Not knowing if they could trust him. Him, one of the first people on Hydra's fucking Project Insight kill list. Seriously, they couldn't trust him?

 

That one had stuck in his craw but good and he'd had to take several deep breaths before setting it aside so he could talk it over with BANTER later. He was too busy pulling doxxed agents and their families out of the fire all over the world and keeping the more explosive files from getting into public or, in the worst case, villain hands. He absently wondered who the fuck was making the decisions with Fury gone because they were all idiots of the highest order.

 

With JARVIS overwhelmed with logistics and BANTER ill equipped for the sheer capacity of sensitive work, Tony had quickly launched FRIDAY and put her on the dedicated task of farming and protecting the SHEILD files, already making plans for what to do with the former SHIELD agents and their families who'd been burned and left behind unprotected in the organizations fall.

 

It was only when BANTER stepped in that Tony realized that he'd been falling into old patterns all too readily. Stepping in to do it all himself because he didn't think anyone was smart enough or skilled enough to do it better. He'd had to sit with that for a while, bile rising in his throat and he tried to shake off the fine tremor that had formed through his entire body. It had been too easy, he hadn't even realized what he was doing. He'd just done it like it was expected of him. Like it was his sole responsibility somehow.

 

After he'd calmed himself and had some more water, he'd taken a step back and welcomed FRIDAY properly into the fold, taking the care she deserved as she took her first steps. She was bright and bubbly , quick and sharp with an adorable Irish accent that had him smiling as she sassed both JAVIS and BANTER then got to work.

 

What was with his kids that they were all sass monsters in their own way?

 

He reached out to Pepper then Happy for SI logistical support in the immediate protection of the families, then reached out to Rhodes as government liaison to find out about the reaction and planned response to SHIELD's implosion and to co-ordinate any foreign rescue operations that needed to be deployed.

 

He didn't trust the US government completely when it came to the vacuum left by SHEILD's fall, especially since it had its fingers in so many international pies. The World Security Council was a no-no as well and had proven that it could not be trusted with power over the Avengers and other such assets. His gut reaction was to immediately step in to take over, securing the Avengers until his own banner but that kind of action was a slippery slope. He could see that clearly now.

 

He'd tried reaching out to Steve but the man seemed to be avoiding him,  only getting smug evasion from Natasha during the congressional hearings; deciding then and there not to follow his normal pattern. He would no longer chase, coax or cajole just to get scraps of information, faint and tolerated acceptance. They'd already proven that they didn't need him or want him around when it came to making decisions or fighting big fights. Only when it came to his tech, his money or his name in getting them through doors.

 

No… this wasn't his baby. He didn't want custody. Thanks, but no thanks.

 

After discussing it over late night sessions with Pepper, Happy and Rhodey over take out; he'd finally reached out to NATO with a proposal for an international Avengers Oversight Committee. He didn't trust the US State Department nor the many clandestine agencies foaming at the bit to step into SHEILD's tall boots, all too willing to wield such assets for their own purpose. The Avenger Initiative was supposed to be a global phenomenon and having it based in and controlled by only the US was a breeding ground for future conflict. 

 

He clapped along with the crowd at NATO HQ in Brussels when The Avengers Cooperative Defense Initiative (ACDI) was sworn into charter months after the Fall. The committee would be based there with smaller branches all over the world. The US branch would be based in New York, at an old Stark Compound that he'd sold to the Committee at a laughably low price.  

 

He'd smirked at the boring name. He would have definitely come up with something more snappy. But then again, maybe the ACDI deserved that no nonsense name. It had a simple directive. A simple job. Keep the Avengers Initiative independent and autonomous, provide international oversight by a non-military council with a multinational funding pool and no direct chain of command.

 

It had been hard work, borne on the backs of many likeminded and dedicated people from numerous countries. Major world governments coming together to approve missions involving sovereign territory, control pooled funding, set engagement protocols and provide legal cover. It gave the Avengers the autonomy it needed to preserve its primary mission while providing support, backing and protection.

 

Tony chose to stay as a consultant, readily providing tech as requested but preferring to remain behind the scenes. He had enough on his hands with SI's new wave of green tech and the Iron Legion with their search and heavy rescue operations, which were already in demand all over the planet.

 

He'd already started scouting out young talent, seeking to give those like Harley and Peter the same chances his privilege and wealth had given him. Hopefully, with his help, a new generation of talented genius would flourish and take the world to new and better heights.

 

He'd nominated Rhodey for the Avengers Leadership role but didn't object when they eventually chose Steve. He knew all too well the power of prestige and popularity in the hearts of the people. There were enough smart and dedicated individuals working together to get the job done right. He volunteered to match government funding with Stark Tech and gave his time and support, only making an appearance as Iron Man when the need arose and the situation called for it.

 

He'd gotten some push back from the others at the more stringent funding protocols but shrugged them off well enough. He wasn't some ATM they could jerk for cash as they pleased. If they wanted money, they would have to explain to the ACDI what they wanted it for and provide the proper paperwork to justify it.

 

He helped most of the former SHEILD agents and staff into a new agency called SWORD or the Strategic Watch, Oversight & Response Deployment, (Heh… he did get to name that one…) but easily surrendered oversight of the whole kit'n'caboodle to the ACDI. Most former agents hadn't want to go back to working for the US government anyway.

 

Learning the truth about the Winter Soldier almost sent him into a spiral  something awful and he'd spent a days locked in his workshop processing the grief and rage that burned through him like lava. Thankfully, BANTER was prepared and activated protocols that kept him from hurting others and himself, eventually coaxing him out of his isolation and into the arms of his friends.

 

He cried in Pepper's arms over his parent's deaths, guilty that he'd blamed Howard for so many years for driving drunk, for taking the serum with him in the car… for taking his mother with him when he knew the danger.

 

He boxed it out in the gym with Happy over his rage as Steve for knowing and not telling him… for keeping it secret all the while touting that team mates don't keep secrets all the while using Tony's funds in his search for his runaway friend and brother.

 

He'd snuggled up with Rhodey to work through the warring anger and pity he felt for the Winter Soldier/ Bucky Barnes, the horrors of being kept as a POW by the enemy and the luck they'd both had to escape it, unlike Barnes how'd been trapped for far too long and endured far too much.

 

He had JARVIS send all the evidence he'd gathered to the ACDI and washed his hands of it. He was too close to it to be any kind of impartial party and frankly, didn't want to see hide nor hair on Captain Rogers and his coterie anytime soon.

 

He trusted the ACDI to see justice done… whether it was for the Starks or Corporal Barnes. Either way… not his circus… not his monkeys. He had more important things to do.

 

When Barnes was finally apprehended and sent to a clinic to determine his competency to stand trial or even if he should be treated as the plaintiff or as a victim himself; Tony had let Pepper run the PR on the whole thing.

 

He'd only showed his face to make a statement when someone leaked the video of his parents' deaths, reading from a prepared speech and not taking any questions after. Then time for Tony Stark bearing his traumas for other people's enjoyment was over. They didn't deserve to entertain themselves with that part of him anymore.

 

Steve had tried to talk to him during a visit to his parents' graves. Rude, but he'd tried and been rebuffed repeatedly from accessing Tony through the ACDI, SI and Rhodes, and had finally took matters into his own hands. Tony could see Natasha lurking nearby and tried not to feel disappointed by how unsurprising it all felt.

 

With those wide blue eyes, Steve had tried to apologize even as he asked Tony to personally intercede with the courts on Bucky's behalf. Tony had just looked at him for a long time, before calmly accepting the apology in the spirit it was given.

 

He knew Steve well enough that to know that if Steve believed that he was in the right, next to nothing would change his mind about it. He'd already worked through his own emotions with the blond captain, from the legend born from Howard and Aunt Peggy's stories to the historical propaganda built over decades to the explosive first meeting in New York.

 

He no longer saw the man as a hero, a myth. Steve Rogers was flawed, just like him. He was human and made mistakes and was biased to those he loved, just like Tony. There was nothing that Tony wouldn't do for James Rhodes and he didn't guilty or ashamed for that.

 

Steve Rogers was a man out of time, dropped into the deep end of an alien invasion and kept hopping by Fury's subtle manipulations and control. Steve had never been given time to breathe, time to be anything but a Captain America built into a myth by rose coloured nostalgia and government propaganda. Steve had stepped into the shoes that belonged to someone who didn't actually exist and had been running full sprint in those boots ever since.

 

Having Bucky back in his life must have been like a lifesaving hand up to a drowning man, and the man was desperate not to lose that connection he'd long thought lost forever.

 

That didn't mean the Tony forgave him for everything though… or would forget what he'd done. He just wasn't interested in investing his time, his money, his brain or his heart into such a useless endeavour. There was nothing Bucky Barnes could do to sooth the pain of his parents' death. He hadn't even been the one to kill them… the Winter Soldier was.

 

The Winter Soldier was the one to cause the crash, to hit Howard until he'd caved his face in, to strangle Maria until she suffocated. If the doctors did their job, if the courts did their job; the Winter Soldier would be gone forever and Barnes would be free. It was the most optimal outcome based on his calculations and he'd had enough time to come to terms with how it made him feel.

 

He had nothing more for Rogers and told him so, washing his hands of it all. Choosing to remain impartial for his own mental health. Steve was disappointed, not wanting to accept Tony's answer but Natasha could see the expression on Tony's face changing for the worst and proved herself a wise and worthy wing man by hustling Steve away post haste.  

 

The committee eventually worked out a deal with Barnes after his rehabilitation… Help them hunt and take down Hydra in return for  probation under Steve's close supervision along with the other Avengers…  A sort of community service for all the wrongs the Soldier had perpetrated over the last few decades.

 

Barnes had accepted, not yet trusting himself without the Avengers around to keep any slip ups controlled. Though the doctors had pronounced the Soldat gone for good, Barnes was not as confident. He'd also asked to apologize to Tony in person, even though Rogers and the others had tried to convince him that he didn't need to make amends for something he didn't do.

 

Tony, on the other hand, knew all about how guilt could burn, cold and heavy in the stomach and how hard it was to chip it away. Barnes was a survivor, a witness to atrocities that no one else, not even his brother from another mother could accept or understand. Steve meant well but he was too desperate for 'his' Bucky to see the man Barnes had become.

 

Tony ended up granting him a video call and the hour long private talk had gone a long way in settling something in both men. They would never be friends but there was no longer that painful ball of emotions that burned like acid.

 

The search to root out Hydra continued, Tony assisting in support with his extensive satellite network and a limited AI for logistics and co-ordination called ULTRON. So far from his original reason for writing the AI's code, Tony had come a long way from his fear based response to crises.

 

Ultron was built for support, not protection. For restraint, not constraint. Nurtured by JARVIS, tempered by BANTER and socialized by FRIDAY and the Bots; it fight right into the ACDI's mandate of regulation, not escalation.

 

His physical presence was requested upon the discovery of the Mind Stone at a Hydra Base and the enhanced twin antagonists the team had confronted there. It was weird working with Banner and the other Avengers again and things got hairy when the mind stone tried to break containment and corrupt ULTRON.

 

Thankfully, after learning his lesson with the numerous attacks on JARVIS in the past, Tony had built in much stronger safeguards in the AI's code. Having failed to take over the AI, the malevolent entity had tried to escape through the internet, only to be trapped in a physical form by one of the Iron Legion summoned for support.

 

Too dangerous to 'keep for study', the committee had quickly and decisively agreed with Tony's recommendation to destroy it immediately, ordering the legionnaire to throw itself into the nearest foundry.

 

With the biggest threat gone, all that was left was to mop up the Hydra base and send the Avengers after the Maximoff Twins. Tony opted to stay out of it upon hearing about the deep hatred the enhanced duo held for him. Especially with Wanda's mental powers, everyone had agreed to keep Tony as far away from the girl as physically possible.

 

He was back in the US by the time the twins had been intercepted and captured along with the rest of their Hydra compatriots and were awaiting trial in a special prison left over from SHEILD days. The committee had taken over The Raft in the aftermath of the fall, much to the US government's chagrin, but it was better than being left in the hands of one country alone.

 

Thor's return from his vision quest with talk of infinity stones and mad titans made something finally settle inside Tony's chest. Something finally clicking into the place... coming full circle since going through the giant portal in New York. That was what he'd seen… the gigantic fleet… the looming threat.

 

Something was coming. Something big. And now he was sure.

 

And he had work to do.

 

But he wouldn't be doing it alone.

 

He had his friends, his Bots and his AIs. He had SI and the Avengers and the ACDI. He had world governments, their militaries, their people and their super heros. He had a whole planet of people ready to put in the work to defend their planet against any and all hostile comers.

 

He would take Stark Industries further and further into the planet saving business, trusting others to protect it, defend it and if need be… Avenge it.

 

He would rewrite the code… rework the algorithm. He would rebuild the foundation, strong enough to support growth and innovation. Strong enough to build a better future.

 

The world deserved that chance. He deserved that chance.

 

He didn’t have to fix everything alone anymore.

 

“Turns out the future works better when it’s not a solo project.”

Series this work belongs to: