added functionality to generate k-fold sets