added comments for the macros, should be self explanatory after that.