replaced debugging macros with inline functions