Adding extra iterator function in sortedSet