Changed the subset method used in the function example