Implemented update function.