Adding friends to the sorting algorithm