sort method added to histogram