int count_tmp = 0;
double Average_Displacement;

double E_grad_dir = 0;

int t_count = 0;

int Exit_flag = 1;

double midline_wall = (Vx[Nv-1] - Vx[0])/2.0;
double Apical_area_initial = Cell_Apical[0];
double Basal_area_initial = Cell_Basal[0];
double Length_initial = Cell_Lengths_1[0];

//cout << "Vx[Nv-1] = " << Vx[Nv-1] << " Vx[0] = " << Vx[0] << " and midline is " << midline_wall << endl;

for (i=0; i<Nv; i++) {
	Vx_nxt[i] = Vx[i];
	Vy_nxt[i] = Vy[i];
	Vz_nxt[i] = Vz[i];
}

//#include "load_init.h"
/*
 for (i=0;i<Nv;i++){
 cout << "V_before(" << i << ") = [" << Vx_nxt[i] << ", " << Vy_nxt[i] << ", " << Vz_nxt[i] << "]" << endl;
 cout << "V_after(" << i << ") = [" << Vx[i] << ", " << Vy[i] << ", " << Vz[i] << "]" << endl << endl;
 }
 */

int* V_side = new int[Nv]; 

for (i=0; i<Nv; i++){
	
	if (Vx[i] < midline_wall) {
		V_side[i] = -1;
	}
	else if (Vx[i] > midline_wall) {
		V_side[i] = 1;
	}
	else {
		V_side[i] = 0;
	}
	//cout << "Vx = " << Vx[i] << " V_side = " << V_side[i] << endl;
}
