added sorting for ree