Implemented edge detection, but it doesn't work.