Added a sort method