Sorts the indicators at the beginning of the function.