Charting added

Note that the charts don't actually work properly yet because there's an
error in the sums and the variable assignment