improve connect_by_2