Added code for identifying edges