adding sortBy method