added sorting for oakland R code