You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: MoritoOrder.m
    path of file: ./repos/mtex/geometry/misorientation
    
    the code of the file until where you have to start completion: function p2c = MoritoOrder(p2c)
% adjusts ordering of variants according to Morito convention
%
% Syntax
%
%   p2c.variantMap = MoritoOrder(p2c)
%
%   p2cV = variants(p2c)
%
% Input
%  p2c - parent to child orientation relationship, @orientation
%
% Output
%  variantMap - reordering of the default MTEX variants
%

% default variant ordering
p2c.opt.variantMap = [];
p2cV = p2c.variants;

% set up planes and directions
% TODO: make this work for OR other than Kurdjumov Sachs
[nParent,nChild,dParent,dChild] = round2Miller(p2cV(1));

csParent = p2cV.CS;
csChild = p2cV.SS;

if angle(nParent,Miller({1 1 1},csParent)) < 5*degree

    
function p2c = MoritoOrder(p2c)
% adjusts ordering of variants according to Morito convention
%
% Syntax
%
%   p2c.variantMap = MoritoOrder(p2c)
%
%   p2cV = variants(p2c)
%
% Input
%  p2c - parent to child orientation relationship, @orientation
%
% Output
%  variantMap - reordering of the default MTEX variants
%

% default variant ordering
p2c.opt.variantMap = [];
p2cV = p2c.variants;

% set up planes and directions
% TODO: make this work for OR other than Kurdjumov Sachs
[nParent,nChild,dParent,dChild] = round2Miller(p2cV(1));

csParent = p2cV.CS;
csChild = p2cV.SS;

if angle(nParent,Miller({1 1 1},csParent)) < 5*degree
  nParent = Miller({1 1 1},{1 -1 1},{-1 1 1},{1 1 -1},csParent);
else
  nParent = nParent.symmetrise;
end