implemented alternative algorithm suggested by Adam for the computation of ranges of segments