update nam's code