function y = initial_velocities(y)
global nElectrons
%set initial velocities in an array where all range from -1 to 1
yRow=y';
v=yRow(3*nElectrons+1:6*nElectrons);
for i=1:3*nElectrons
    ra(i)=rand();
    if (ra(i)>.5) %decide which v components are positive and negative
        v(1,i)=rand();
    else
        v(1,i)=-1*rand();
    end
yRow=[yRow(1:3*nElectrons) v];
y=yRow';
end

