buggy simplified edge detection finished