with custom key= function for tuple sort