function [t] = tree(varargin)
t.data = struct([]);
t.children = {};
t.level = [];
t.max_levels = 0;
if mod(length(varargin),2) ~= 0
    % input args have not com in pairs, woe is me
    error('Arguments to tree must come param/value in pairs.')
end
for i=1:2:length(varargin)
    switch lower(varargin{i})
        case 'data'
            t.data = varargin{i+1};
        otherwise
            error(['Unknown parameter name passed to tree.  Name was ' varargin{i}])
    end
end
t = class(t, 'tree');

