finished methods for building graph from functions of modules, but need to refactor all of it)