Adds sort function.