updated upperBound to return upper instead of lower bound from size hint