subsetting function - frack what a waste of time... :(