added sorting, feature category handling