new version of edge detection