Updated graph methods and adding caching