edge detection code broke