completed data cleaning script for d213