function P2CVL1()
% This solution goes with the original handout specification.

sigma = 10; rho = 28; beta = 8/3; eta = sqrt(beta*(rho-1));
u = [rho-1;eta;eta];       % Attractor1
v = [rho-1;-eta;-eta];     % Attractor2

tFinal = 94; y0 = u/3 + 2*v/3;

[Enter1,Exit1,Enter2,Exit2,tOut,yOut] = LorenzZones(y0,tFinal);

clc
fprintf('Initial y = [%10.3f  %10.3f  %10.3f]\n\ntFinal    = %10.3f\n\n',y0,tFinal)
fprintf('          Zone 1              Number \n  EnterTime   ExitTime        Orbits\n')
fprintf('--------------------------------------------------------------------\n')
for k=1:length(Enter1)
    % The comet is entering Zone 1 at this time...
    Enter1_time = Enter1(k);
    if k<=length(Exit1)
        % It actually exits Zone 1...
        Exit1_time = Exit1(k);
    else
        % Or the simulation stops while it is in Zone 1...
        Exit1_time = tFinal;
    end
    % Count how many times the comet enters and exits Zone 2 during the
    % time interval [Enter1_time,Exit1_time]...
    orbitCount = sum(Enter1_time <= Enter2 & Exit2 <= Exit1_time);
    fprintf('%10.3f  %10.3f          %2d\n', Enter1_time,Exit1_time,orbitCount)
end

2 points total. -1 for faulty counting, -1 for insufficient comments, -1 an event function that
doesnt work