sort an array of arrays by a key