bug found in the getSegmentNumber routine

this has now been fixed