cleaned rest of code