new but ugly update function