Working version of the simple branch and bound and improved branch and bound