new way to detect edges1