Add id to elements and sort descending to display last elements