Added some functionality to update()