implemented local_update