Add subsetting function.