faster infinity detection