Added few functions prepareupdate(), doupdate(), etc.