untested implementation of loadGraph