sort uses id as secondary

the sort function uses the id to sort the item