Improved/commented graphing script