added codes for creating dataset given selection boolean vector and the dataset