starting the body of the 3rd (pairs) algo