changed BUFF_INFINITY to use double max