clean up graph code, and make two-axis graph