subset function added