Added some code for macros