some cleanup and working cdoc macro...