Added upper_bound algorithm