added an update method, and took bad stuff out