First Write of stats cleanup script

stats cleanup script with sanitize functions.