added generate_folds.m