Program obly shows one branch and changed to midpoint algorithm