Update the sorting and the PDP functions.