Changed to edge detection