Cleaning and Error Checking