Perform ordering of data.