working on prepare-chart