Okay so I think that Allegiant's ending was a bit unfair so I created my own ending here and sorry it's a lot like the book but fingers crossed and go easy cause it's my first fanfic...

Tris

"HOW DID YOU inoculate yourself against the death serum?" he asks me. He's still sitting in his wheelchair, but you don't need to be able to walk to fire a gun.

I blink at him, still dazed.

"I didn't," I say.

"Don't be stupid," David says. "You can't survive the death serum without an inoculation, and I'm the only person in the compound who possesses that substance."

I just stare at him, not sure what to say. I didn't inoculate myself. The fact that I'm still standing upright is impossible. There's nothing more to add.

"I suppose it no longer matters," he says. "We're here now."

"What are you doing here?" I mumble. My lips feel awkwardly large, hard to talk around. I still feel that oily heaviness on my skin, like death is clinging to me even though I have defeated it.

I am dimly aware that I left my own gun in the hallway behind me, sure I wouldn't need it if I made it this far.

"I knew something was going on," David says. "You've been running around with genetically damaged people all week, Tris, did you think I wouldn't notice?" He shakes his head. "And then your friend Cara was caught trying to manipulate the lights, but she very wisely knocked herself out before she could tell us anything. So I came here, just in case. I'm sad to say I'm not surprised to see you."

"You came here alone?" I say. "Not very smart, are you?"

His bright eyes squint a little. "Well, you see, I have death serum resistance and a weapon, and you have no way to fight me. There's no way you can steal four virus devices while I have you at gunpoint. I'm afraid you've come all this way for no reason, and it will be at the expense of your life. The death serum may not have killed you, but I am going to. I'm sure you understand—officially we don't allow capital punishment, but I can't have you surviving this."

He thinks I'm here to steal the weapons that will reset the experiments, not deploy one of them. Of course he does.

I try to guard my expression, though I'm sure it's still slack. I sweep my eyes across the room, searching for the device that will release the memory serum virus. I was there when Matthew described it to Caleb in painstaking detail earlier: a black box with a silver keypad, marked with a strip of blue tape with a model number written on it. It is one of the only items on the counter along the left wall, just a few feet away from me. But I can't move, or else he'll kill me.

I'll have to wait for the right moment, and do it fast.

"I know what you did," I say. I start to back up, hoping that the accusation will distract him. "I know you designed the attack simulation. I know you're responsible for my parents' deaths—for my mother's death. I know."

"I am not responsible for her death!" David says, the words bursting from him, too loud and too sudden. "I told her what was coming just before the attack began, so she had enough time to escort her loved ones to a safe house. If she had stayed put, she would have lived. But she was a foolish woman who didn't understand making sacrifices for the greater good, and it killed her!"

I frown at him. There's something about his reaction—about the glassiness of his eyes—something that he mumbled when Nita shot him with the fear serum—something about her.

"Did you love her?" I say. "All those years she was sending you correspondence . . . the reason you never wanted her to stay there . . . the reason you told her you couldn't read her updates anymore, after she married my father . . ."

David sits still, like a statue, like a man of stone.

"I did," he says. "But that time is past."

That must be why he welcomed me into his circle of trust, why he gave me so many opportunities. Because I am a piece of her, wearing her hair and speaking with her voice. Because he has spent his life grasping at her and coming up with nothing.

I hear footsteps in the hallway outside. The soldiers are coming. Good—I need them to. I need them to be exposed to the airborne serum, to pass it on to the rest of the compound. I hope they wait until the air is clear of death serum.

"My mother wasn't a fool," I say. "She just understood something you didn't. That it's not sacrifice if it's someone else's life you're giving away, it's just evil."

I back up another step and say, "She taught me all about real sacrifice. That it should be done from love, not misplaced disgust for another person's genetics. That it should be done from necessity, not without exhausting all other options. That it should be done for people who need your strength because they don't have enough of their own. That's why I need to stop you from 'sacrificing' all those people and their memories. Why I need to rid the world of you once and for all."

I shake my head.

"I didn't come here to steal anything, David."

I twist and lunge toward the device.

The gun goes off it hits me in the foot and pain races through my body.

I can still hear Caleb repeating the code for Matthew. With a quaking hand I type in the numbers on the keypad.

The gun goes off again but this time it doesn't hits me. I hear Caleb's voice speaking again. The green button.

So much pain.

But how, when my body feels so numb?

I start to fall, and slam my hand into the keypad on my way down. A light turns on behind the green button.

I hear a beep, and a churning sound.

I slide to the floor. I feel something warm on my neck, and under my cheek. Red. Blood is a strange color. Dark.

From the corner of my eye, I see David slumped over in his chair. His shoulder is covered with blood from a recent gunshot.

And my mother walking out from behind him.

She is dressed in the same clothes she wore the last time I saw her and I'm guessing by the gun in her hand she's the one who shot David! I know that's crazy and pretty much impossible but by the look on her face it seems like that. There are still bullet holes in her shirt; through them I can see her wounded skin, red but no longer bleeding, like she's frozen in time. Her dull blond hair is tied back in a knot, but a few loose strands frame her face in gold.

I know she can't be alive, but I don't know if I'm seeing her now because I'm delirious from the blood loss or if the death serum has addled my thoughts or if she is here in some other way.

She kneels next to me and touches a cool hand to my cheek.

"Hello, Beatrice," she says, and she smiles.

And all I can ask her is "Did you shot him?" She replies "Yes I did, he was wrong and you did the right thing stopping him." After a short pause she says "I'm proud of you honey, I'm proud of everything you did and I'm proud of all the sacrifices you are willing to make, and I know your father's proud of you too" Her eyes are now bright with tears and so are mine. With a shaky voice I ask "Does it means I'm d-dead?" She replies in a clear yet sad voice "Well you fought off the death serum and you only got shot on your shoulder and leg which means that you are not dead." The tears finally start falling from my eyes and I ask in a shaky but desperate voice "A-Are you alive?" A part of me desperately wants her to say she's alive but a part of me think is it too selfish to even ask? She replies "Honey I only came here to help you, I am no longer in this world but I'll always be alive in your heart." She kisses my forehead, squeezes my hand and walks towards the bright beam of light and vanishes. I'm back in my senses now, wide awake. David is still in front of me on a wheelchair and in a slump. I am injured, badly injured but I've never felt this strong and weak both at the same time. The death serum's effects have worn off me and also from the compound though I do feel dizzy. I hear voices, somebody's coming. I lift my head to see who it is and I'm surprised to find Tobias rushing towards me, his face looks worried and it looks like he was crying. Mathew is trailing behind him. Tobias picks me up and carries me towards the clinic the last thing I see before I go unconscious is Christina and Mathew standing near the door. And Tobias crying. When I wake up the first thing I see is Tobias' worried face, he is sitting next to my bed with a worried look on his face. His eyes are red and puffy from crying, he hasn't yet noticed I'm awake. I mumble "Hey" Tobias' face brightens up he holds my hand tightly and says "Why? Why? Tris Why? I thought you loved me and wanted to be with me forever!; I cut him before he gets further and say " I didn't wanted to, I still do, I do love you and I still want to be with you forever, but I couldn't let Caleb die out of guilt, I could never deliver my brother to his own execution. And that was what I was exactly doing, I knew there was a chance I'd survive but there was no chance he would. And look I'm alive here right in-front of you." He seems more relaxed now than he was before and replies "I understand, but what about me? You don't know how much it would've hurt me to lose you, I love you Tris" I say "I love you too Tobias and I'm sorry but it felt just the thing to do' He smiles and says "its okay, n hey do you know that you have been sleeping for two days." "Oh crap, what did I miss?" I say. He tells me about what happened in the city and he tells me about Evelyn, I do feel happy for him, He tells me that my mission was accomplished and the bureau is under the memory serum and that David is in the hospital and there aren't much chances of him recovering. I feel happy and I feel bad for feeling happy but I can't help it. Tobias also tells me about Uriah, Hana and Zeke.