fixed ordering in segment boundary deviation