cleanup graphing code