update the whole code