ed;
    wn = DCMbn * wb_corrected;


    % Velocity update
    vel = vel_update(fn, vel_e(i-1,:), omega_ie_n, omega_en_n, gn_e(i-1,:)', dti);
    vel_e (i,:) = vel;

    % Position update
    pos = double(pos_update([lat_e(i-1) lon_e(i-1) h_e(i-1)], vel_e(i,:), dti));
    lat_e(i) = double(pos(1));
    lon_e(i) = double(pos(2));
    h_e(i)   = double(pos(3));

    % Turn-rates update with both updated velocity and position
    omega_ie_n = earth_rate(lat_e(i));
    omega_en_n = transport_rate(lat_e(i), vel_