added functional to extract data from all folds in train_X