adding the sorting script