sorting
sort by value and key