added the graphing functionality