function [H, HI, Dp, Dm, e_1, e_m] = upwind4(m,h)

    H=spdiag(ones(m,1),0);
    H(1:4,1:4)=spdiag([49/144 61/48 41/48 149/144]);
    H(m-3:m,m-3:m)=fliplr(flipud(spdiag([49/144 61/48 41/48 149/144])));
    H=H*h;
    HI=inv(H);


    Qp=(-1/4*spdiag(ones(m-1,1),-1)-5/6*spdiag(ones(m,1),0)+3/2*spdiag(ones(m-1,1),+1)-1/2*spdiag(ones(m-2,1),+2)+1/12*spdiag(ones(m-3,1),+3));
    %Q_U = [-0.49e2 / 0.2640e4 0.11167e5 / 0.15840e5 -0.1541e4 / 0.7920e4 0.43e2 / 0.5280e4; -0.9403e4 / 0.15840e5 -0.551e3 / 0.2640e4 0.1779e4 / 0.1760e4 -0.2311e4 / 0.7920e4; 0.659e3 / 0.7920e4 -0.751e3 / 0.1760e4 -0.1541e4 / 0.2640e4 0.21287e5 / 0.15840e5; 0.51e2 / 0.1760e4 -0.551e3 / 0.7920e4 -0.3683e4 / 0.15840e5 -0.713e3 / 0.880e3;];
    %Q_U = [-0.29e2 / 0.1680e4 0.7067e4 / 0.10080e5 -0.961e3 / 0.5040e4 0.23e2 / 0.3360e4; -0.6023e4 / 0.10080e5 -0.331e3 / 0.1680e4 0.1119e4 / 0.1120e4 -0.1451e4 / 0.5040e4; 0.439e3 / 0.5040e4 -0.491e3 / 0.1120e4 -0.961e3 / 0.1680e4 0.13507e5 / 0.10080e5; 0.31e2 / 0.1120e4 -0.331e3 / 0.5040e4 -0.2383e4 / 0.10080e5 -0.453e3 / 0.560e3;];

    Q_U = [-0.1e1 / 0.48e2 0.205e3 / 0.288e3 -0.29e2 / 0.144e3 0.1e1 / 0.96e2; -0.169e3 / 0.288e3 -0.11e2 / 0.48e2 0.33e2 / 0.32e2 -0.43e2 / 0.144e3; 0.11e2 / 0.144e3 -0.13e2 / 0.32e2 -0.29e2 / 0.48e2 0.389e3 / 0.288e3; 0.1e1 / 0.32e2 -0.11e2 / 0.144e3 -0.65e2 / 0.288e3 -0.13e2 / 0.16e2;];

    Qp(1:4,1:4)=Q_U;
    Qp(m-3:m,m-3:m)=flipud( fliplr(Q_U(1:4,1:4) ) )'; %%% This is different from standard SBP

    Qm=-Qp';

    e_1=zeros(m,1);e_1(1)=1;
    e_m=zeros(m,1);e_m(m)=1;

    Dp=HI*(Qp-1/2*e_1*e_1'+1/2*e_m*e_m') ;

    Dm=HI*(Qm-1/2*e_1*e_1'+1/2*e_m*e_m') ;
end
