Added strdup to prevent overwrite in codeArray