add min and max macros