Edge detector that works.