sorting: slice array in 3