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: rectify.m
    path of file: ./repos/OpenFace/matlab_version/face_detection/mtcnn
    
    the code of the file until where you have to start completion: function [bbox_out] = rectify(bbox_in)
	
    %convert bboxA to square
    heights = bbox_in(:,4) - bbox_in(:,2);
	widths = bbox_in(:,3) - bbox_in(:,1);

    max_side = max([widths'; heights'])';
    
    % Correct the starts based on new size

    
function [bbox_out] = rectify(bbox_in)
	
    %convert bboxA to square
    heights = bbox_in(:,4) - bbox_in(:,2);
	widths = bbox_in(:,3) - bbox_in(:,1);

    max_side = max([widths'; heights'])';
    
    % Correct the starts based on new size
    new_min_x = bbox_in(:,1) + 0.5 * (widths - max_side);
    new_min_y = bbox_in(:,2) + 0.5 * (heights - max_side);
    
    bbox_out = [new_min_x, new_min_y, new_min_x + max_side, new_min_y + max_side];
end