segment: implement wrap around