Alternative logic proposition

See comments in the code
Here is the Build Pool - it is responsible for scheduling tasks and sorting them (from leafs to the roots).