added new features to analysis macros