adding edge detection and refactored circle detection