progress on matching. Implementing PMatch in graph.cpp