started work on the chart builder helper function