Suggestion by Jonathan Williamson, and thanks to
Walid Shouman for noticing that the existing code
worked if a test to prohibit it were removed.
Limitation: treats segments > 1 the same as
segments == 1 in this case; a TODO to do
something more intelligent.