improved canny implementation
restructured canny