sorting in two arraies