capture script needs to sort