rewrote how update is done