added support for edges, using recursive pattern matching, need to update docs and docstrings