fix bug with lower_bound and adding unique switch points