Added custom sort method