implemented graphing functionality