add path and amplitude limitations in shift_up and shift_down algorithms.