changes to cleaning code