function [fold1, fold2, fold3, fold4, fold5, fold6, fold7, fold8, fold9, fold10] = divideInto10(dataset)

% define folds
fold1 = [];
fold2 = [];
fold3 = [];
fold4 = [];
fold5 = [];
fold6 = [];
fold7 = [];
fold8 = [];
fold9 = [];
fold10 = [];

% firstly sort the dataset according to the effort values in inc. order
effortValues = dataset(:,size(dataset,2));
[sortedEffortValues sortedIndices] = sort(effortValues, 'ascend');
sortedDataset = dataset(sortedIndices,:);

% now dividing dataset into 10 pieces
foldSize = floor(size(dataset,1)/10);

for i = 1:10
    if i == 10
        eval(['dataPiece' num2str(i) ' = dataset(((' num2str(i-1) ')*' num2str(foldSize) '+' num2str(1) '):size(dataset,1),:);']);
    else
        eval(['dataPiece' num2str(i) ' = dataset(((' num2str(i-1) ')*' num2str(foldSize) '+' num2str(1) '):(' num2str(i*foldSize) '),:);']);
    end
end

% randomize these pieces
for i = 1:10
   eval(['dataPiece' num2str(i) '= randomizeDataset(dataPiece' num2str(i) ');']); 
end

% then bring them together
datasetToDistribute = [];
for i = 1:10
   eval(['datasetToDistribute = [datasetToDistribute;dataPiece' num2str(i) '];']); 
end


% now distribute the parts into folds 
for i = 1:size(dataset,1)
    if mod(i,10) == 1
        fold1 = [fold1;datasetToDistribute(i,:)];
    elseif mod(i,10) == 2
        fold2 = [fold2;datasetToDistribute(i,:)];
    elseif mod(i,10) == 3
        fold3 = [fold3;datasetToDistribute(i,:)];
    elseif mod(i,10) == 4
        fold4 = [fold4;datasetToDistribute(i,:)];
    elseif mod(i,10) == 5
        fold5 = [fold5;datasetToDistribute(i,:)];
    elseif mod(i,10) == 6
        fold6 = [fold6;datasetToDistribute(i,:)];
    elseif mod(i,10) == 7
        fold7 = [fold7;datasetToDistribute(i,:)];
    elseif mod(i,10) == 8
        fold8 = [fold8;datasetToDistribute(i,:)];
    elseif mod(i,10) == 9
        fold9 = [fold9;datasetToDistribute(i,:)];
    else
        fold10 = [fold10;datasetToDistribute(i,:)];
    end
end

end