changed return type from arraylist to TreeSet