Upper Bound C Implementation