added sorting for results