sorting and agg methods fixes for figures