Implement sorting arrays by multiple columns at once