DISCLAIMER: Star Trek: Voyager and all its characters belong to Paramount Pictures; no infringement of copyright is intended. The story however belongs to me.

AUTHOR'S NOTES: This is my entry for VAMB's Secret Summer Exchange 2013. The request came from Delwin, who asked for a developing friendship/working relationship between B'Elanna Torres and a character of my choice, preferably set early in the series.

A big thank you once again to ghosteye99 for the much appreciated beta, and apologies to Delwin for submitting an un-betaed version in the exchange. That deadline was just too tight. Naturally, all remaining mistakes are my own.

Written August 2013.

The Measure of a Friend
By Hester (hester4418)

Tom Paris hit the transporter controls. From the corner of his eye, he saw the golden-hued Cravic ship fire repeatedly on the silver Pralor vessel. But then, his attention was caught by a bluish sparkle at the back of the shuttle that coalesced into the form of B'Elanna Torres. She was looking at him, somewhat startled but relieved, but then she collapsed as soon as the transporter effect faded.

Tom activated another control on his console. "Shuttle to Voyager. I've got her but she's injured. Tell the Doctor to stand by. Beam her out as soon as I clear the defense field."

The captain's voice replied, calm as ever. "Acknowledged, Mister Paris."

Not wasting any time, Tom plotted a course away from the Pralor and Cravic ships and back to Voyager. Thankfully, none of the robots paid him any attention while they continued their absurd fight for dominance. Once he was far enough away, the transporter came to life again, whisking B'Elanna away. Seconds later, sickbay called to confirm that she had arrived safely. Sighing with relief, Tom hurried to return home.

-==/\==-

B'Elanna Torres' personal log, Stardate 49316.4:

The last few days have been nothing but disaster. I thought I was doing the right thing, the 'ethical' thing. Even if Captain Janeway refused to see it that way when I first presented the robots' dilemma to her. In a way, I was almost happy when 3947 kidnapped me, because he only forced me to do what I would have wanted anyway. And then it all went wrong, so completely, and horribly wrong.

I trusted him – it – whatever. It didn't even occur to me that a machine might be capable of deceiving me. And by trusting him, I betrayed the captain's trust in me. But it was the only way to save Voyager. I hope she'll be able to forgive me, even though in her eyes I broke the Prime Directive.

But the worst part is... Even when 3947 was threatening me, part of me was thrilled by the task, the challenge of creating the perfect power module. And I succeeded – oh, it was incredible. The moment the prototype sat up and asked for programming, I felt... elated. Excited. I never –

"How are you feeling, Lieutenant?"

Startled, B'Elanna looked up, and quickly deactivated the padd she was using to record her log. The Doctor was approaching her, tricorder in hand. He waved the instrument up and down her body, adjusted the controls and repeated the scan.

B'Elanna warily eyed the holographic physician. "Do you really want to know, or are you just making small talk?"

"Both." The Doctor snapped the tricorder shut. "Although the tricorder tells me objectively that you should be feeling, as the phrase goes, 'good as new', I have learned from experience that the subjective patient's view can differ quite significantly from that. And since, in the absence of a ship's counselor, it is apparently expected of me to treat emotional disorders as well, I thought it best to get the question out of the way now, before releasing you, to spare you the effort of having to come back later."

"How thoughtful." The words came out sounding even less friendly than she'd meant to say them.

Unperturbed, the Doctor looked at her expectantly. "So, how are you feeling?"

Something in his tone made her snap. "Truthfully? Rotten! In the past three days I have not only almost caused Voyager to be destroyed; I also had to break the Prime Directive in order to protect the ship. And in doing that, I almost tipped the scales in a robotic civil war, which could have had severe repercussions for the whole quadrant." She pounded her fist on the side of the biobed in frustration. "And all because I thought I could trust a machine!"

"As I recall, the captain supported your wish to study the robot."

"Yes, but Tuvok argued against it. Turns out he was right. We should have devoted more effort to accessing the unit's memory cells. If we had been able to learn something about the Pralor and Cravic history, about their societies, Voyager would never have been in any danger. We'd have returned him to his people and went on our way."

"Without reactivating him?"

B'Elanna averted her eyes from the Doctor's probing gaze. "Possibly."

"I do not believe you would have been able to resist the challenge."

"What makes you say that?" she snapped, bristling again.

The Doctor started ticking off his observations. "You came in here, in the middle of the night, asking for my input on an engineering problem. You appeared rather desperate at the time, as I recall. And as soon as I presented you with a new option, you stormed off again; ready to try anything and everything."

"You're right," she admitted. "From the moment I saw him, all I could think of was what a wonderfully sophisticated piece of engineering he was, and how much I could learn from studying him. I never once stopped to consider the dangers."

She went silent, blankly staring at the padd in her lap. Then she looked up again, despair evident in her expression. In a whisper, she asked, "Where did I go wrong?"

"You thought you could control the machine," the Doctor replied, his tone much gentler than before. "But this robot was unlike any machine you ever encountered before."

"He was... unique," she agreed, nodding. "Or at least I thought he was, until I met the others of his kind. They were all so... belligerent. So uncaring of others. They were all just single-mindedly following their programming. When I first got to know 3947, I was impressed by the things he told me about how the robots had adapted to being left to their own devices. How they had learned to make repairs to themselves. I thought they had evolved beyond their original programming and learned from their experiences. I thought they were... more like you."

"How flattering to be compared to mindless killing machines," the Doctor remarked dryly.

"I didn't mean it like that!" B'Elanna exclaimed, frustrated. "I meant that I thought that they were capable of personal growth, of becoming more than the sum of their parts and programming." She sighed. "In hindsight, it would probably have been better for all involved parties if we hadn't revived the unit."

"So do you now regret it?" he prompted.

B'Elanna sighed again. Despite the outcome, she could not really regret having 'met' Automated Personnel Unit 3947, or the things she had learned about robot construction by examining him. If she was completely honest with herself, she had immensely enjoyed working on the prototype; in fact she'd thrived on the challenge.

The whole experience had been the most rewarding, yet also the most unsettling one of her time in the Delta Quadrant this far; maybe even her entire life.

Throughout most of her life, B'Elanna had felt more comfortable around machines than around people. Maybe it was because machines didn't judge her, wouldn't make fun of her, and wouldn't even argue with her. They did what she told them to do – most of the time, anyway –, and if they didn't, she usually found a way to fix that too.

You couldn't just 'fix' people like that. People wanted to be cajoled and convinced, neither of which B'Elanna had much inclination or patience for. The only exceptions to that were Chakotay and the captain – Chakotay because he knew her inside and out, almost better than she knew herself. He had always believed in her despite her own self-doubts. Janeway, because she'd given her the benefit of the doubt, and allowed her to prove herself without prior judgment. She wasn't sure how she would face either of them now.

She knew in hindsight that her main mistake had been to let herself become emotionally attached to 3947, without knowing anything about his background. He had used that to his advantage, and betrayed her twice. First by abducting her, and secondly by withholding crucial information about the fate of the Builders, and the current state of his 'society'.

"No," she finally admitted. "But I regret not having asked him more questions, or not trying hard enough to access his memory cells. If only I had known about the Builders' fate..."

"What happened to them?" the Doctor asked gently.

B'Elanna had already filed her official report about the things she had learned during her captivity, but apparently the Doctor had not read it yet – or maybe he preferred to hear it from her personally.

She explained, "The Pralor and the Cravic had been enemies for years, building those robots to fight for them. But at some point, the Builders called a truce, which would have meant that the automated personnel units would have lost their primary function. They probably would have been reprogrammed or even dismantled. So they turned on their creators, and terminated them."

"You could call that an act of self-preservation," the Doctor observed.

Momentarily taken aback, B'Elanna could only stare at him. "Are you defending them?"

He shrugged. "I am merely pointing out the obvious. These are sentient – if mechanical – beings. It is only natural for them to want to protect their existence."

"But where does it stop?!" B'Elanna exclaimed. Agitated, she slid off the biobed and started pacing. When she passed by the Doctor, she looked up, searching his face. "I have the ability to completely alter or even destroy your programming," she said. "Do you hate me for that?"

The Doctor's reply was as instantaneous as it was indignant. "Hate you? No!" Then he hesitated, and his features lost some of their earlier self-assuredness. "Although I can't deny a certain... apprehension at the thought that you might ever use that ability. I've grown quite fond of my various subroutines."

"But you wouldn't even know," B'Elanna countered. "I could easily wipe your memory banks and give you a completely new personality. I could change your physical parameters to make you look Andorian or Klingon." She smirked. "I could even make you female."

"Another Klingon female on board Voyager?" The Doctor regarded her archly. "I highly doubt that we'd be able to coexist on the same ship for any length of time."

"But that's just it! If we didn't get along, I could simply change your programming, and make you more agreeable to work with." B'Elanna paced the floor of the Doctor's office, running her hands through her hair in frustration. The EMH's next question brought her up short.

"Then why didn't you?"

She stared at him. "Excuse me?"

"Why didn't you?" the Doctor repeated. Seeing her obvious confusion, he clarified, "Many times since my initial activation, various crewmembers have voiced a desire for me to be more caring or compassionate, as well as less direct, sarcastic or blunt. Their suggestions for 'improving' my programming were quite numerous."

"But – you wouldn't have been 'you' anymore."

"Which is precisely what some people would prefer," the Doctor remarked dryly.

B'Elanna was silent. He was right, she knew. Especially in the beginning of their trek through the Delta Quadrant, complaints about the Doctor's lack of bedside manners had been an almost daily occurrence.

She decided to be brutally honest. "We had discussed it," she said, and watched the Doctor's eyebrows lift in surprise at her admission.

"I suspected as much," the hologram replied, his voice uncharacteristically soft.

"You have to understand," B'Elanna hastened to add. "You're our only physician. People were opting to treat themselves instead of going to you. In the long run, that could have been detrimental to everyone's survival. So I suggested a few... program updates to the captain."

"You did?"

"I did," she confirmed, not flinching from his incredulous stare. "And the captain almost agreed. But then, she had a change of heart."

"Why?"

"As far as I know, Kes had something to do with it. Apparently, she convinced the captain that you should be treated as a member of the crew, instead of a convenient tool that can be shut on and off at everyone's whim."

A smile appeared on the Doctor's face as he remembered how Janeway had come to him and asked if there was anything she could do for him. It had been the first time he had truly felt that someone other than Kes was taking him seriously. "She is very wise for all of her two years," he said fondly.

"Anyway, Captain Janeway decided that if we were to treat you the same as any other crewmember, that would of course mean accepting your personality as it is – despite the obvious flaws," B'Elanna said with a note of irony.

The Doctor was about to make a comment, but she did not give him the chance.

"And she was right," she added softly. "I realized that, too. Of course it would have been easier to change you, instead of telling everyone to accept you the way you are. But I just want to let you know that although I have the ability to change your personality subroutines, I won't. Not unless your program is about to collapse and we have no other choice. And I don't think that's likely."

"I am quite a sophisticated piece of programming after all, equipped with numerous safety buffers and failsafe routines," the Doctor replied rather smugly, but B'Elanna could see that underneath the cheerful exterior he was profoundly touched.

A moment later, he sobered. "I thank you for your frankness, Lieutenant," he said.

She thought back to the first time she'd had to dig deeply into his programming. Voyager had been trapped inside the event horizon of a quantum singularity, and the resulting spatial distortions had caused the Doctor's holoimage to shrink.

Repairing that had not been a priority as his diagnostic subroutines had not been affected and they'd had much more pressing matters on their minds – like getting Voyager out of the singularity before it was destroyed. But once the primary crisis was past, B'Elanna had discovered that restoring the Doctor to his original height was not simply a matter of reconfiguring the holoemitters around sickbay.

At the time, the captain's top priority had been to get the warp engines back online; and Janeway had all but ordered the chief engineer to simply reset the Doctor's program to its default parameters, in the hopes that that procedure would take care of the height problem. However, despite all her other work, B'Elanna had vehemently argued against this 'instant fix' since she'd feared a repeat occurrence.

In her view, it was far better to get to the root of the problem first, and then guard against any future malfunctions of a similar nature. Ultimately, the captain had agreed; and after some laborious code analysis B'Elanna had found the cause of the malfunction and repaired it, thus preserving the memories the Doctor had accumulated up to that point. But even so, she had not considered him a person then. That had only come later, after Kes' intervention.

After the Doctor pronounced her fit for duty and released her from sickbay, B'Elanna headed for the mess hall. She had been provided with 'nutritional supplements' while being held on the Pralor ship, but those had been bland and almost indigestible.

She had found herself missing Neelix' cooking, and had vowed to try to show more appreciation for his culinary creations, at least for a little while. Beside that, maybe it would do her some good to spend some more time among people.

She chuckled to herself as she boarded the turbolift. That was certainly a new notion for her. For most of her life, she had avoided people rather than seeking out their company.

People could be mean. Growing up, B'Elanna had always been an outsider – the strange one, the wild one. The Klingon. The word alone had been an insult, whether it was whispered in her ear or boldly shouted across the school yard. She hadn't been able to understand why her mother was proud to be Klingon, and had told her to stand up and defend her heritage when all B'Elanna wanted was to blend in, to belong, like everyone else.

If her father had stayed around, it might have been different. But he had left them, his Klingon wife and Klingon child, and B'Elanna had paid the price.

Yet only last year, after literally coming face to face with that 'darker' half of her personality, had she been able to accept that being Klingon was just as much a part of her as being human. She'd begun to realize that without her Klingon side, she would be incomplete.

Life had become marginally easier after she'd had that revelation, and accepted it. Since then she was getting better at controlling her temper, and at not snapping at people for no good reason.

But she still favored the quiet company of the warp drive or a plasma injector over forced interactions with people who thought she needed more friends. She had friends – Chakotay, and Harry – and that was quite enough for now.

Or was it?

-==/\==-

Half an hour later, B'Elanna sat stunned by the conversation she'd just had. The captain had just left, after giving her shoulder another reassuring pat.

Janeway had been full of compassion and understanding for what the engineer had gone through by destroying the prototype she had built herself; she had also been full of admiration for B'Elanna's success in 'giving the unit life'.

It had been the complete opposite of the scolding and dressing-down she had expected. Instead of condemning her for what she had been forced to do, the captain had praised her for her achievements.

But Janeway was a scientist at heart, and she had helped with reviving 3947. That had given her more than a passing idea of the level of sophistication in his construction. If anyone could understand the magnitude of the task B'Elanna been faced with, it would be her.

B'Elanna took another sip of Neelix' surprisingly palatable coffee and turned, facing the room instead of turning her back on it.

Maybe she did need more friends. People who would understand, instead of machines which would only follow orders. She'd have to give that thought some serious consideration.

-==/\==-

B'Elanna Torres' personal log, Stardate 49468.3:

Apparently, I haven't learned a thing. After what happened with the Pralor and Cravic robots, I thought I was over trusting the machines. But here we are, less than two months later, and I've been blindsided again.

But this time, it's even worse than before, because I have only myself to blame. My younger self, to an extent, for thinking that I had anticipated every possible scenario. But also my current self, because once again I let myself be lured into false security by a machine I thought I could control.

Just like the last time, she had woken up in sickbay, and like last time the Doctor had treated her injuries and asked the requisite questions. Only this time, B'Elanna found herself unable to talk to him. He had released her with a frown, urging her to call on him any time day or night if necessary. She did not intend to take him up on the offer.

Within a very short amount of time, her faith in machines had been betrayed a second time, and that had shaken her more than she would admit to anyone. Suddenly the company of a hyperspanner and a magnetic flux regulator seemed dangerous, as if they might fail her next. She no longer felt comfortable working alone in a Jeffries tube, always expecting the computer to start an unstoppable countdown.

Harry had said that Dreadnought was only as smart as she made it. She had told him that she doubted that, that it was adaptive and had been collecting data for a long time.

What she hadn't been able to say at the time – what she hadn't even been able to think then – was that Dreadnought had definitely evolved from its original programming. It had learned to lie, and it had skillfully manipulated and deceived her – she, who had spent weeks perfecting the missile's programming. In the end, it had almost killed her.

B'Elanna's thoughts made her attention waver, and her hand slipped. She cursed out loud when the plasma relay she had been working on suddenly exploded in a shower of sparks. She shielded her face just in time, but her hands and forearms sustained several nasty burns from the escaping superheated plasma that ate right through her uniform.

B'Elanna stared at her wounds in dismay, momentarily too shocked to feel any real discomfort. Now she would have to go to sickbay and face the Doctor again, and she was not at all prepared for the scrutiny that was sure to ensue.

Sickbay was quiet when she arrived. By now her hands and lower arms were throbbing with pain, and her voice came out as a constrained grunt.

"Computer, activate Emergency Medical Holographic Program."

"Please state the nature –" the Doctor began his customary spiel, but he broke off immediately when B'Elanna extended her arms in his direction.

"What happened?" he snapped brusquely, simultaneously pushing her towards a biobed and picking up a medical tricorder.

"A plasma relay exploded," she explained meekly. So far, she had always taken pride in the fact that she'd never had this kind of accident. It was a typical rookie's blunder, something that just did not happen to someone with her level of experience.

The Doctor arched an eyebrow, but said nothing. He set the tricorder aside and picked up a hypospray which he pressed against the engineer's neck. A soft hiss, and B'Elanna felt the pain subside.

"Thank you," she breathed with relief and tried to flex her fingers.

"Please hold still so I can treat those burns," the Doctor snapped.

Taken aback by his brusqueness, B'Elanna obediently stopped moving and just watched as the dermal regenerator slowly repaired her skin.

"Done," the holographic physician announced several minutes later.

B'Elanna cautiously moved her fingers, and then rotated her wrists. Everything was back to normal, except for the burn holes in her uniform.

"Looks like I'll need to spend this week's replicator rations on a new uniform," she quipped half-heartedly. When there was no reply, she looked up.

The Doctor was studying her with an air of mixed puzzlement and exasperation.

"What?" B'Elanna asked defensively.

"Please tell me what's bothering you."

Despite his customary frown, his voice was much gentler than she was used to hearing, and she appreciated his coming straight to the point. Still, she wearily shook her head.

"I'm not sure I can."

"Try," he urged.

She regarded him for a few long moments, absently rubbing her newly healed hands together. Finally, she sighed. "All right."

She swung her legs around so they dangled off the biobed, and braced herself on her arms. "Remember the last time I was here, and we talked about controlling the machines?"

The Doctor nodded. "Of course I do."

"Well, it seems that my control is slipping rapidly. First an alien robot outmaneuvers me, and then a computer I programmed myself almost succeeded in killing me."

"The operative word in this case being 'almost'," the Doctor cut in quickly.

B'Elanna glared at him. "It also 'almost' killed two million people on a peaceful planet. If I hadn't succeeded in disabling it..."

"But you did," he interrupted her again. "You destroyed your own handiwork in order to prevent mass destruction. Not everyone would have been able to do that."

"What if..." B'Elanna bit her lip. "What if next time, I'm too late? Or worse, if I find that I cannot do what is necessary?"

She could not meet his eyes as she said the words, and the Doctor was overcome by a sudden realization.

"Are you referring to my program?" he asked, incredulous.

After a beat of hesitation, B'Elanna nodded.

"Are you... Are you afraid that I will betray you?" He seemed positively shocked by the notion.

"The thought had crossed my mind," she admitted. Then, more defensively, she added, "After what happened during the past couple of weeks, can you really blame me? It's like every piece of unfamiliar machinery or programming that I touch turns against me. Last year, I had to reconfigure some of your subroutines. Who knows what I may have triggered that we don't know about yet?"

The Doctor was silent, weighing her words. Then he asked, "Did you program Seska?"

Confused, B'Elanna couldn't follow the Doctor's train of thought. "What do you mean?"

"She was your friend, was she not? So conceivably you knew her better than most of the other people you work with. And yet she still managed to deceive you."

"Which only goes to show that I have a lousy track record with machines and people," she huffed.

"That is not the point I am trying to make."

"Then what is your point?"

"It could happen with anyone," he said softly. "Or anything. And to anyone, come to think of it. Some things just happen. You can try to anticipate them, try to guard against them; but in the end, there's nothing you can do. Whether it's a program glitch or a friend who turns into an enemy, you'll have to take it in stride; try to do better next time, but still accept that there may be circumstances beyond your control."

"Machines and computers are supposed to be under my control," B'Elanna muttered darkly.

The Doctor regarded her thoughtfully for a moment. Then he unexpectedly stepped forward and enveloped her in a gentle hug.

B'Elanna yelped in surprise and struggled to free herself. When the Doctor moved back, she glowered at him. "What the hell was that for?"

He smiled rather smugly. "Did you program me to do that?"

"Of course not!"

"Do you think it was part of my original programming?"

The engineer recalled the surly holographic reproduction of Dr. Lewis Zimmerman, the 'father' of the EMH, whom she had met briefly during a previous problem with the hologrid. She snorted. "Not likely."

"Do you feel threatened by me?" he probed.

"No," she replied, and then stopped. Suddenly she understood what he was trying to tell her. "You're saying that not being in control is not necessarily a bad thing," she said, watching his face. "That sometimes good things happen, even when you least anticipate them."

"Precisely," he confirmed.

B'Elanna slid down from the biobed and they stood facing each other.

"Thank you," she said, feeling slightly awkward, but the Doctor's genuine smile quickly dissipated the feeling.

"You're welcome," he said simply, gave her a brief pat on the arm and disappeared into his office.

Deep in thought, B'Elanna returned to her quarters.

-==/\==-

B'Elanna Torres' personal log, Stardate 50255.6:

I've been working for twelve hours straight trying to find a way to prevent the cascade failure threatening the Doctor's program. So far, I haven't had much luck, and time is running out.

Earlier, in sickbay, Kes said just what I felt: The Doctor is not merely a computer program anymore. He's come too far for that, so I need to find a way to help him without wiping his memories. But now the captain has ordered me to engineering, to help with the shield reconfiguration.

I've left the Jupiter Station diagnostic program running, in the hopes that Dr. Zimmerman will be able to pinpoint the problem. I just hope that he will succeed before it is too late – because I would hate to lose a friend.

Feverishly working at a console in engineering to complete the shield modifications Harry had given her, B'Elanna Torres couldn't help her thoughts returning to the holodeck and the hapless Doctor.

She had been relieved when the captain decided that the Doctor deserved a chance at having his memories preserved, instead of opting for the 'quick fix' of simply reinitializing the EMH program.

But so far they still had not been able to pinpoint the source of the problem, much less find a solution. Kes was keeping an eye on both the EMH and his creator, but B'Elanna desperately wished that she could be there to help.

Just when had she begun to think of the Doctor as a friend, instead of 'only' a hologram? Probably after her experience with Dreadnought, about nine months previously. He had shown her true compassion then, and had managed to calm her irrational fears of losing her touch for delicate engineering problems and computer programming.

To have his program revert to its default parameters now was simply... unthinkable. Despite being made of photons and forcefields, the Doctor was as real to her as any of her fellow officers, and she felt much closer to him than to most of the people she worked with.

He could still be abrasive at times, but he was honest and direct – qualities she appreciated. To lose him now would be like watching a friend die, and she wasn't ready to give up on him yet.

With renewed determination, B'Elanna forced her mind to focus on the shield modifications. The sooner she got done here, the sooner she could head back to the holodeck.

-==/\==-

When the first notes of the Doctor's humming reached her, B'Elanna could scarcely believe her ears. She looked over at Kes, and found the young Ocampa's expression of disbelief tinged with hope mirroring her own. The humming soon turned into words, sung in a low voice which obviously was not meant for an audience.

Kes and B'Elanna exchanged bright, relieved smiles. Then Kes quietly withdrew to the far side of sickbay to work at one of the consoles.

B'Elanna remained where she was and just savored the moment, letting the Doctor's rich baritone wash over her. They had done it. There was absolutely no doubt in her mind that the procedure recommended by the Zimmerman hologram had been a complete success. Some of the EMH's memory subroutines might take a while longer to reinitialize than others, but in the end he would be fine.

'Their' Doctor was still there, and he would have the chance to grow ever further. And maybe someday he would even gain the ability to leave sickbay and explore areas of the ship that were inaccessible to him now.

She wasn't sure yet how she'd pull it off, but she could already picture his smile of surprise and delight. That would be her way of repaying him for the times she had been in need of a sympathetic ear. Despite his sometimes gruff exterior, the Doctor had shown himself to be a genuinely caring individual. One who watched out for those people who chose to look past his flaws and accept him the way he was.

And that, she realized, was what friends were for.

-==/ The End \==-