codes re-designed