manually implemented xOrder