change to avoid quadratic growth of branches