Implementation of update-function

First version of the update-function