Fixes issue #10
A correct implementation in issue #10 for plotting graphs