improved boundary cases