added saving of final chart array