added macros to derive upper limits