cleaned the code some more