Added sorted direction.