Geometry checked and corrected with sampling option.