three arrays for sorting