add macros and tests