restructing codes