codes_used helper