pair wise optimization bug fix num sent