Sort elements from the right table