complete order by function