update substructure code