maybe move the +inf to a const?