cleaned the code briefly