added min/max macros