added sorting for consistent results