recleaned the code