Adds upper bound for hitting algorithm.