Edit to data processing code in charts script to improve motion chart