Copied other graph lab, without traversal methods.