add klist and update codes struct