implementation of update - first version