function [K,MC,Ge,Ce,V,DP,btotg,B,D,detJt]=Hexa20(E,NU,rho,coordor,n27,Ns27,Nt27,Nu27,Ns8,Nt8,Nu8,GyroFlag)

D = (E/((1+NU)*(1-2*NU)))*[1-NU NU NU 0 0 0 ;
    NU 1-NU NU 0 0 0 ;
    NU NU 1- NU 0 0 0 ;
    0 0 0 (1-2*NU)/2 0 0 ;
    0 0 0 0 (1- 2*NU)/2 0 ;
    0 0 0 0 0 (1- 2*NU)/2];


[MC,V,DP,Ge,Ce]=Masses20(rho,coordor,n27,Ns27,Nt27,Nu27,GyroFlag);

% 3x3x3
% [btotg, detJt,Tra, detra2, B]=BmatrixH203x3(coordor);
% [Ktot]= KbrickH203x3(btotg,D,detJt,detra2);
% 2x2x2
[btotg, detJt,Tra, detra2, B]=BmatrixH20(coordor,Ns8,Nt8,Nu8); %2x2x2
[Ktot]= KbrickH20(btotg,D,detJt,detra2); %2x2x2

ACell = repmat({Tra}, 1, 20);
Tr = blkdiag(ACell{:});

B=B/V;

MC=reorder_dof20(MC);
if GyroFlag == 1
    Ge=Ge-Ge.';
end

K=Tr'*Ktot*Tr;

end
