changed BUFF_INFINITY to use DBL_MAX