added update() function