added a subset function