cleaning and testing code