started code to check for edges