changed naming convention, improved edge finding