updated a lot of code