cleaned the code