adding the code for charts