add segnum to debugging