Update the zorder function