Mercy/Ernesto Refactor scripts for charting in correct order