Generalize graph and some new example scripts