Finished BetweennnessAlgorithm