added sobel's revision