function [hodTrain, labelsTrain, hodTest, labelsTest] = computeDescriptors(config)
    data = {};
    testdata = {}; % to remove the matlab warning; which I hate
    if strcmp(config.dataset,'MSRAction3D')
        fprintf('Loading action set %i from MSRAction3D ...\n', config.actionset);
        switch config.actionset
            case 1
                load MSRAction3D_AS1
            case 2
                load MSRAction3D_AS2
            case 3
                load MSRAction3D_AS3
            otherwise
                throw(MException('MSRAction3D:ActionSetWrongIndex', 'You have to provide which action set to use when using MSRAction3D.'))
        end
        fprintf('Loaded Successfully.\n');
    end
    nJoints = config.nJoints;
    nBins = config.nBins;
    nLevels = config.nLevels;
    nProjections = 3;
    nParts = (2 ^ nLevels) - 1;
    
    fprintf('Creating HOD for training data ...\n');
    len = size(data, 1);
    hodTrain = zeros(1, nJoints, nParts, nProjections * nBins);
    ind = 1;
    for i=1:len
       sequence = data{i};
       if validSequence(sequence, config)
           nFrames = size(sequence, 1) / nJoints;

           x = reshape(sequence(:,1), nJoints, nFrames); % x
           y = reshape(sequence(:,2), nJoints, nFrames); % y
           z = reshape(sequence(:,3), nJoints, nFrames); % z

           for j=1:nJoints
               hodTrain(ind, j, :, :) = computeHOD(x(j,:), y(j,:), z(j,:), config);
           end
           labelsTrain(ind) = labels(i);
           ind = ind + 1;
       end
    end
    fprintf('Created Successfully - removing %i corrupted sequence.\n', len - size(hodTrain, 1));
    fprintf('Creating HOD for testing data ...\n');
    tlen = size(testdata, 1);
    hodTest = zeros(1, nJoints, nParts, nProjections * nBins);
    ind = 1;
    for i=1:tlen
       sequence = testdata{i};
       if validSequence(sequence, config)
           nFrames = size(sequence, 1) / nJoints;
           
           x = reshape(sequence(:,1), nJoints, nFrames); % x
           y = reshape(sequence(:,2), nJoints, nFrames); % y
           z = reshape(sequence(:,3), nJoints, nFrames); % z
           
           for j=1:nJoints
               hodTest(ind, j, :, :) = computeHOD(x(j,:), y(j,:), z(j,:), config);
           end
           labelsTest(ind) = testlabels(i);
           ind = ind + 1;
       end
    end
    fprintf('Created Successfully - removing %i corrupted sequence.\n', tlen - size(hodTest, 1));
end

