added script to clean up data files, and made plotting script more modular