update working no error checking
with error checking