Finished UPDATE function