Added macros to functions