Updated the update function

Included new parameters