x-wrapping example and algorithm