update codes and comments