function sortedList = sortedAdd(element, list)
    if(isempty(list))
        sortedList = element;
        return;
    end
    head = list(1);
    if element.id < head.id
        sortedList = [element list];
    else 
        sortedList = [head sortedAdd(element, list(2:length(list)))];
    end
end