Add SORT_BY procedure and specs