Added alternate edge detection algorithm.