implemented macro logic and sample macros