Added macro and  diagnostics