function CloseAAMtoolbox
global AAMShapemodel_figure_handle
global AAMModelGenerator_handle
global AAMModelBuilder_handle
global AAMSetPicker_handle
global UpdateModel_handle
global PDMWalk_handle
global PMTemplateBuilder_handle
global ShapeSpaceTool_handle
global PreProcess_gui_handle
global PointCloudProcessor_handle
global axesFig_handle
global axesFig_handleA
global PlaceLandmarks_gui_handle

if exist('PlaceLandmarks_gui_handle')
    if ishandle(PlaceLandmarks_gui_handle)
        delete(PlaceLandmarks_gui_handle);
    end
end
if exist('axesFig_handle')
    if ishandle(axesFig_handle)
        delete(axesFig_handle);
    end
end
if exist('axesFig_handleA')
    if ishandle(axesFig_handleA)
        delete(axesFig_handleA);
    end
end
if exist('PreProcess_gui_handle')
    if ishandle(PreProcess_gui_handle)
        delete(PreProcess_gui_handle);
    end
end
if exist('ShapeSpaceTool_handle')
    if ishandle(ShapeSpaceTool_handle)
        delete(ShapeSpaceTool_handle);
    end
end
if exist('PointCloudProcessor_handle')
    if ishandle(PointCloudProcessor_handle)
        delete(PointCloudProcessor_handle);
    end
end
if exist('PMTemplateBuilder_handle')
    if ishandle(PMTemplateBuilder_handle)
        delete(PMTemplateBuilder_handle);
    end
end
if exist('UpdateModel_handle')
    if ishandle(UpdateModel_handle)
        delete(UpdateModel_handle);
    end
end
if exist('AAMSetPicker_handle')
    if ishandle(AAMSetPicker_handle)
        delete(AAMSetPicker_handle);
    end
end
if exist('AAMModelBuilder_handle')
    if ishandle(AAMModelBuilder_handle)
        delete(AAMModelBuilder_handle);
    end
end
if exist('AAMModelGenerator_handle')
    if ishandle(AAMModelGenerator_handle)
        delete(AAMModelGenerator_handle);
    end
end
if exist('AAMShapemodel_figure_handle')
    if ishandle(AAMShapemodel_figure_handle)
        delete(AAMShapemodel_figure_handle);
    end
end
if exist('PDMWalk_handle')
    if ishandle(PDMWalk_handle)
        delete(PDMWalk_handle);
    end
end
clear global;
