first final code with single detail per tag only