works when boundary points are removed. From derivation