attempted to clean the code