Reworking algorithm for producing correct chart

The chart is not comming out correctly as the code does not correctly map
the chart goal to the actual chart. It needs to be rethought. In the
meantime creating the actual chart goal seems to be working although in
this commit it is commented out for debugging puprposes.