First pass done for upper bound