changed a lot of code