update code, although it has not been tested