added edge detection test code