encapsulate
build a graph