Adding check to allow edges to be optional