Added graphing code - not 100% yet