Improve data-structure for monotonic curves.