added header file with the usual macros, use them in a few places