Simplify distToBoundary