added graphing functionality