changed code for branch and bond method