function [options] = getOptions(options,varargin)
    % biafra ahanonu
    % updated: 2013.12.10
    % gets default options for a function, restrict by pre-defined names in options structure

    validOptions = fieldnames(options);
    varargin = varargin{1};
    for i = 1:2:length(varargin)
        val = varargin{i};
        if ischar(val)&~isempty(strmatch(val,validOptions))
            	% use ability to reference
                options.(val) = varargin{i+1};
        else
            continue;
        end
    end