- added sort function