added update method and tests