added logics
added macros