Recursive solution, library, much optimized with lower bounding value