Sorting arrays by sub value