add more function:

now it can do [0,3],[3,6],[6,9] correctly (discrete array)