Start of implementing graph functions