Implement the upperBound function in order to satisfy the tests