order by first implementation