function [smallest, largest] = min_and_max (arg1, arg2, arg3)
    
    smallest = arg1;
    if (arg2 < smallest)
        smallest = arg2;
    end
    if (arg3 < smallest)
        smallest = arg3;
    end
    
    largest = arg1;
    if (arg2 > largest)
        largest = arg2;
    end
    if (arg3 > largest)
        largest = arg3;
    end

end
