Beginning of sorting array